from django.db import models

# 导入时间域
from django.utils import timezone

# 基类
class Base(models.Model):

    #时间字段
    create_time = models.DateTimeField(default=timezone.now,null=True)

    class Meta:
        abstract = True

# 用户表
class User(Base):
    username = models.CharField(max_length=200)
    password = models.CharField(max_length=200)
    img = models.CharField(max_length=200)
    # 用户类别
    type = models.IntegerField(default=0,null=True)
    # 手机号
    phone = models.IntegerField()

    # 个人主页
    num = models.IntegerField(default=0,null=True)

    class Meta:
        db_table = "user"